"""
@-*- coding: utf-8 -*-
@ python: 3.12.3
@ 创建者: JacksonCode
@ 创建时间: 2025-11-05
"""
import requests
import execjs

with open("./1.index.js", 'r',encoding='utf-8') as f:
    js_code = f.read()

ctx = execjs.compile(js_code)

headers = {
    "accept": "*/*",
    "accept-language": "zh-CN,zh;q=0.9",
    "cache-control": "no-cache",
    "origin": "https://dewu.com",
    "pragma": "no-cache",
    "priority": "u=1, i",
    "referer": "https://dewu.com/",
    "sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-site",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
    "Accept": "*/*",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Content-Type": "application/json",
    "Origin": "https://dewu.com",
    "Pragma": "no-cache",
    "Referer": "https://dewu.com/",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-site",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
    "traceparent": "00-f57319f9690b62b23c8cb32250ae11dc-16871c3a8c0cc0c0-01"
}
cookies = {
    "sensorsdata2015jssdkcross": "%7B%22distinct_id%22%3A%22198eebd02c91f2-07abca5782b438-26011051-1204049-198eebd02ca972%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMTk4ZWViZDAyYzkxZjItMDdhYmNhNTc4MmI0MzgtMjYwMTEwNTEtMTIwNDA0OS0xOThlZWJkMDJjYTk3MiJ9%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%22%2C%22value%22%3A%22%22%7D%2C%22%24device_id%22%3A%22198eebd02c91f2-07abca5782b438-26011051-1204049-198eebd02ca972%22%7Dsensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22198eebd02c91f2-07abca5782b438-26011051-1204049-198eebd02ca972%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMTk4ZWViZDAyYzkxZjItMDdhYmNhNTc4MmI0MzgtMjYwMTEwNTEtMTIwNDA0OS0xOThlZWJkMDJjYTk3MiJ9%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%22%2C%22value%22%3A%22%22%7D%2C%22%24device_id%22%3A%22198eebd02c91f2-07abca5782b438-26011051-1204049-198eebd02ca972%22%7D"
}
url = "http://app.dewu.com/api/v1/h5/commodity-pick-interfaces/pc/pick-rule-result/feeds/info"
# data = {"sign": "a44fa02883cc1342f22c7dfefea1d9e9", "pageNum": 1, "pageSize": 20}
data = {#"sign": "f2b6b4c666227d52fdadf251f307445d",
        "pickRuleId": 644479,
        "pageNum": 1,
        "pageSize": 24,
        "filterUnbid": "true",
        "showCspu": "true"}

sign = ctx.call("c",data)

data["sign"] = sign
print(data)

response = requests.post(url, headers=headers,cookies=cookies,  json=data)
print(response.text)
print(response)
